﻿using System;
using System.CodeDom;
using System.Collections.Generic;
using System.ComponentModel.Design.Serialization;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace ExpressionTreeLib.ViewModels
{
    [ExpressionType(typeof(MemberExpression))]
    public class MemberAccessViewModel : NodeViewModel
    {
        public string MemberName { get; private set; }

        protected override Expression CreateExpression()
        {
            throw new NotImplementedException();
        }

        public override void LoadExpressionNode(Expression expression)
        {
            var maExp = expression as MemberExpression;
            this.MemberName = maExp.Member.Name;
            
            base.LoadExpressionNode(expression);
        }
    }
}
